@using Abc.Core;
@using Abc.Application;
@model Abc.Application.NoticeOut;
@{
    ViewData["Title"] = "NoticeInfo";
}

<section class="panel panel-padding">
    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">

        <form class="layui-form" action="">
            <input type="hidden" asp-for="Id" />
            <div class="layui-form-item">
                <label class="layui-form-label">通知类型代码</label>
                <div class="layui-input-block">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    @*<i class="layui-icon layui-icon-about" style="font-size: 30px; color: #dddddd;"></i>*@
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">标题</label>
                <div class="layui-input-block">
                    <input asp-for="Title" lay-verify="Title" autocomplete="off" placeholder="请输入标题" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    @*<i class="layui-icon layui-icon-about" style="font-size: 30px; color: #dddddd;"></i>*@
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">内容</label>
                <div class="layui-input-block">
                    <input asp-for="Content" lay-verify="Content" autocomplete="off" placeholder="请输入内容" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    @*<i class="layui-icon layui-icon-about" style="font-size: 30px; color: #dddddd;"></i>*@
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">是否读取</label>
                <div class="layui-input-block">
                    @*<input type="checkbox" asp-for="IsRead" lay-skin="primary" title="" checked="">
                        <input type="checkbox" name="like[read]" title="阅读" checked="">*@
                    <input type="checkbox" asp-for="IsRead" lay-skin="switch" lay-text="开|关">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    @*<i class="layui-icon layui-icon-about" style="font-size: 30px; color: #dddddd;"></i>*@
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">读取状态</label>
                <div class="layui-input-block">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    @*<i class="layui-icon layui-icon-about" style="font-size: 30px; color: #dddddd;"></i>*@
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">用户ID</label>
                <div class="layui-input-block">
                    <input asp-for="UserId" lay-verify="UserId" autocomplete="off" placeholder="请输入用户ID" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    @*<i class="layui-icon layui-icon-about" style="font-size: 30px; color: #dddddd;"></i>*@
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">扩展json数据字段</label>
                <div class="layui-input-block">
                    <input asp-for="ExtensionData" lay-verify="ExtensionData" autocomplete="off" placeholder="请输入扩展json数据字段" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    @*<i class="layui-icon layui-icon-about" style="font-size: 30px; color: #dddddd;"></i>*@
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">创建用户ID</label>
                <div class="layui-input-block">
                    <input asp-for="CreatorUserId" lay-verify="CreatorUserId" autocomplete="off" placeholder="请输入创建用户ID" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    @*<i class="layui-icon layui-icon-about" style="font-size: 30px; color: #dddddd;"></i>*@
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">创建用户</label>
                <div class="layui-input-block">
                    <input asp-for="CreatorUserName" lay-verify="CreatorUserName" autocomplete="off" placeholder="请输入创建用户" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    @*<i class="layui-icon layui-icon-about" style="font-size: 30px; color: #dddddd;"></i>*@
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">创建时间</label>
                <div class="layui-input-block">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    @*<i class="layui-icon layui-icon-about" style="font-size: 30px; color: #dddddd;"></i>*@
                </div>
            </div>

            @*
                <textarea placeholder="请输入内容" class="layui-textarea"></textarea>
                <input type="radio" name="sex" value="男" title="男" checked="">
                <input type="radio" name="sex" value="女" title="女">
                <input type="radio" name="sex" value="禁" title="禁用" disabled="">
            *@
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <div class="layui-btn" lay-submit lay-filter="submit">提交数据</div>
                    <button id="closewindow" class="layui-btn layui-btn-danger">关闭窗口</button>
                </div>
            </div>
        </form>
    </div>
</section>

@*<script src="~/lib/ckeditor4/ckeditor.js"></script>*@
@section Scripts{
    <script>
    layui.define(['element', 'upload', 'jquery', 'form', 'table', 'laydate'], function () {
        var $ = layui.jquery
            , upload = layui.upload,
            form = layui.form,
            table = layui.table,
            laydate = layui.laydate,
            element = layui.element;

        //提交
        form.on('submit(submit)', function (obj) {
            //obj.field.IsEnable=$('#IsEnable').is(':checked');
            //obj.field.Remark = Remark.getContent();
            $.post("@(Url.Action("Info"))", obj.field, function (result) {
                if (result.State) {
                    //var index = parent.layer.getFrameIndex(window.name);
                    //parent.layer.close(index);//关闭当前页
                }
                layer.msg(result.Msg);
            });

            return false;
        });
        //关闭当前页面
        $("#closewindow").on("click",function(){
            //当你在iframe页面关闭自身时
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            parent.layer.close(index); //再执行关闭
        });

        //form.verify({
        //    Name: function (value) {
        //        if (value <= 0) {
        //            return 'Name不能为空';
        //        }
        //    },
        //    Money: [
        //        /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/
        //        ,'支付金额错误，最多2位小数，不能以小数点结尾'
        //    ],
        //});

        //生成时间监听
        //有时间字段才有下面的代码
          // var arrDateEle = 'ReadTime,CreationTime';
           app.initDate(ReadTime,CreationTime);
    });
    </script>
}
@*  //Tab 选项卡
    //<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
    //  <ul class="layui-tab-title">
    //    <li class="layui-this">网站设置</li>
    //    <li>用户管理</li>
    //    <li>权限分配</li>
    //    <li>商品管理</li>
    //    <li>订单管理</li>
    //  </ul>
    //  <div class="layui-tab-content" style="height: 100px;">
    //    <div class="layui-tab-item layui-show">内容不一样是要有，因为你可以监听tab事件（阅读下文档就是了）</div>
    //    <div class="layui-tab-item">内容2</div>
    //    <div class="layui-tab-item">内容3</div>
    //    <div class="layui-tab-item">内容4</div>
    //    <div class="layui-tab-item">内容5</div>
    //  </div>
    //</div> *@